/**
 * Copyright &copy; 2012-2016 civet All rights reserved.
 */
package cn.mcsys.myadmin.modules.goods.service;

import java.util.List;

import cn.mcsys.myadmin.common.persistence.Page;
import cn.mcsys.myadmin.modules.goods.dao.GoodsCategoryDao;
import cn.mcsys.myadmin.modules.sys.utils.UserUtils;
import cn.mcsys.myadmin.modules.sys.utils.UserUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.mcsys.myadmin.common.persistence.Page;
import cn.mcsys.myadmin.common.service.CrudService;
import cn.mcsys.myadmin.modules.goods.entity.GoodsCategory;
import cn.mcsys.myadmin.modules.goods.dao.GoodsCategoryDao;

/**
 * 商品分类Service
 * @author Jockey
 * @version 2016-11-20
 */
@Service
@Transactional(readOnly = true)
public class GoodsCategoryService extends CrudService<GoodsCategoryDao, GoodsCategory> {

	public GoodsCategory get(Integer id) {
		return super.get(id);
	}
	
	public List<GoodsCategory> findList(GoodsCategory goodsCategory) {
		return super.findList(goodsCategory);
	}
	
	public Page<GoodsCategory> findPage(Page<GoodsCategory> page, GoodsCategory goodsCategory) {
		return super.findPage(page, goodsCategory);
	}
	
	@Transactional(readOnly = false)
	public void save(GoodsCategory goodsCategory) {
		super.save(goodsCategory);
	}
	
	@Transactional(readOnly = false)
	public void delete(GoodsCategory goodsCategory) {
		super.delete(goodsCategory);
	}

	/**
	 * 所有商品分类信息
	 * @return
	 */
	public List<GoodsCategory> findAllGoodsCategory(){
		return UserUtils.getGoodsCategoryList();
	}
}